//
//  LeftStyleTableViewCell.swift
//  ZNZXSuperMarket
//
//  Created by 四川中农 on 2018/7/26.
//  Copyright © 2018年 四川中农. All rights reserved.
//

import UIKit

class LeftStyleTableViewCell: UITableViewCell {
    @IBOutlet weak var shadowView: UIView!
    
    @IBOutlet weak var goodsImg: UIImageView!
    @IBOutlet weak var goodsName: UILabel!
    @IBOutlet weak var goodsContent: UILabel!
    @IBOutlet weak var spareLabel: UILabel!
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        self.shadowView.setCornerRadio(radio: 10, isMask: false)
        self.shadowView.setShadow(color: "000000", offset: CGSize.init(width: 0.9, height: 1.3), radius: 10, opacity: 0.2)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func reload(with model:SiteGoodsModel){
        self.goodsImg.my_setImage(url: model.img, placeholder: Api.placeHolder.rawValue)
        self.goodsName.text = model.name
        self.goodsContent.text = model.activityDesc
        
        self.spareLabel.attributedText = Utils.changeLabelTextFontSize(normalString:"    每套立省\(model.price - model.activityMoney)元    ", changeString: "\(model.price - model.activityMoney)", font: UIFont.systemFont(ofSize: 17))
    }

}
